<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String path = request.getContextPath(); %>
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.5.1.min.js"></script>
<script>
    $(function () {
        $("#file").change(function () {
            $("#upload").submit();
        });
    });
</script>
<form action="/zhuang/upload/uploadPic" method="post" enctype="multipart/form-data" id="upload">
    <input id="file" name="file" type="file"><br>
    <c:if test="${param.msg eq 'size'}">
        <span style="color:red;">上传文件超出大小(100K以内)</span>
    </c:if>
    <c:if test="${param.msg eq 'ext'}">
        <span style="color:red;">上只能上传图片(jpg,jpeg,png,gif)</span>
    </c:if>

</form>

